{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Tucker for random sampling\n",
    "import rss\n",
    "\n",
    "parameters = {}\n",
    "net_list = []\n",
    "net_list.append({'net_name':'TF','sizes':[256,256,1],'dim_cor':[256,256,1],'mode':'tucker'})\n",
    "\n",
    "parameters['net_p'] = {'gpu_id':3,'net_name':'composition','net_list':net_list}\n",
    "parameters['data_p'] = {'data_shape':(256,256),'random_rate':0,\n",
    "                        'pre_full':True,'mask_type':'random','ymode':'denoising'}\n",
    "parameters['train_p'] = {'train_epoch':10}\n",
    "parameters['show_p'] = {'show_type':'red_img','show_content':'original'}\n",
    "rssnet = rss.rssnet(parameters)\n",
    "\n",
    "rssnet.show()\n",
    "rssnet.show_p['show_content'] = 'recovered'\n",
    "for i in range(10):\n",
    "    rssnet.train()\n",
    "    rssnet.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# INR for random sampling\n",
    "import rss\n",
    "\n",
    "parameters = {}\n",
    "net_list = []\n",
    "net_list.append({'net_name':\"SIREN\",'dim_in':2,'w0_initial':50,'dim_hidden':256,'dim_out':1})\n",
    "\n",
    "# net_list.append({'net_name':\"SIREN\",'dim_in':2,'w0_initial':100})\n",
    "parameters['net_p'] = {'gpu_id':3,'net_name':'composition','net_list':net_list}\n",
    "parameters['data_p'] = {'data_shape':(256,256),'random_rate':0,\n",
    "                        'pre_full':False,'mask_type':'random','ymode':'denoising'}\n",
    "parameters['train_p'] = {'train_epoch':10}\n",
    "parameters['show_p'] = {'show_type':'red_img','show_content':'original'}\n",
    "rssnet = rss.rssnet(parameters)\n",
    "\n",
    "rssnet.show()\n",
    "rssnet.show_p['show_content'] = 'recovered'\n",
    "for i in range(10):\n",
    "    rssnet.train()\n",
    "    rssnet.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# TF->INR\n",
    "import rss\n",
    "\n",
    "parameters = {}\n",
    "net_list = []\n",
    "net_list.append({'net_name':'TF','sizes':[256,256,1],'dim_cor':[256,256,1],'mode':'tensor'})\n",
    "net_list.append({'net_name':'Interpolation','return_type':\"feature\"})\n",
    "net_list.append({'net_name':\"SIREN\",'dim_in':1,'w0_initial':50,'dim_hidden':256,'dim_out':1})\n",
    "\n",
    "parameters['net_p'] = {'gpu_id':3,'net_name':'composition','net_list':net_list}\n",
    "parameters['data_p'] = {'data_shape':(256,256),'random_rate':0.,\n",
    "                        'pre_full':False,'mask_type':'random','ymode':'denoising'}\n",
    "parameters['train_p'] = {'train_epoch':10}\n",
    "parameters['show_p'] = {'show_type':'red_img','show_content':'original'}\n",
    "rssnet = rss.rssnet(parameters)\n",
    "\n",
    "rssnet.show()\n",
    "rssnet.show_p['show_content'] = 'recovered'\n",
    "for i in range(10):\n",
    "    rssnet.train()\n",
    "    rssnet.show()"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
